<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title></title>
	</head>
	<body>
	<object id="print" classid="clsid:e66af9b5-0bf1-4047-9b6d-6bad1b5e48d1" codebase="http://www.HongShijin.com/"></object>
	<object id="print0" class="HongShijin.PrintActiveX.PrintMechanically" codebase="http://www.HongShijin.com/"></object>
	<a href="javascript:void(0);" onclick="javascript:setText(document.body.innerHTML);">Call Set Text</a>
	<a href="Test.xml" onclick="javascript:toPrint(this.href); return false;">toPrint</a>
	<a href="Test.xml" onclick="javascript:showPreview(this.href); return false;">showPreview</a>
	
	<input id="url" type="text" /><input type="button" value="preview" onclick="javascript:showPreview(url.value)" />
	<textarea id="xml" style="width: 100%;" rows="50">
L:\HongShijin-C#\HongShijin.PrintActiveX\Test.htm
http://218.22.179.198/hnhis/ZYCY/zyfp.aspx?HospId=340521555&RegisteNo=200807110003&HospEnterNo=200807120001</textarea>
	<script type="text/javascript">
	function setText(value)
	{
	    try
	    {
	        document.getElementById("print").Text = value.replace(/></img, ">\r\n<");
	        //document.getElementById("print").SetText(value);	        
	    }
	    catch (x)
	    {
	        alert(x.message);
	    }
	}
	
	function showPreview(url)
	{
	    try
	    {
	        document.getElementById("print").loadData(url);
	        document.getElementById("xml").value = document.getElementById("print").Text;
			document.getElementById("print").preview();
	    }
	    catch(x)
	    {
			alert(x.message);
			alert(document.getElementById("print").Error);
			alert(document.getElementById("print").Error.StackTrace);
	    }
	}
	
	function toPrint(url)
	{
	    try
	    {
	        document.getElementById("print").loadData(url);
			document.getElementById("print").print();
	    }
	    catch(x)
	    {
			alert(x.message);
			alert(document.getElementById("print").Error);
			alert(document.getElementById("print").Error.StackTrace);
	    }
	}
	</script>
	</body>
</html>